

{{define "content"}}
{{$pageTitle:="编辑用户"}}
<style>
</style>
<div class="head">
    <div class="title">
        {{$pageTitle}} {{.T.Help $pageTitle}}
    </div>
</div>
<div>
    <ul class="mydetail">
        <li>
            <label>用户名</label>
            <input class="mylongtext" type="text" id="name" name="name" value="{{.model.Name}}" />(用户名必须为字母,且保证唯一)
        </li>
<!--        <li>-->
<!--            <label>角色</label>-->
<!--            <select id="role" name="role">-->
<!--                <option value="0" ${Html.w(model.role==0,"selected='selected'","")}>普通用户</option>-->
<!--                <option value="1" ${Html.w(model.role==1,"selected='selected'","")}>管理员</option>-->
<!--            </select>-->
<!--        </li>-->
        <li>
            <label>密码</label>
            <input class="mylongtext" type="text" id="psd" name="psd" value="{{.model.Psd}}" />
        </li>
        <li>
            <input type="button" class="btn1" style="" value="保存" onclick="return save()" />
        </li>
    </ul>
</div>
<script type="text/javascript">
    function save()
    {
        $.post("/admin/user/save",
            {
                "id": {{.T.D .model.Id "0"}},
                "name": $("#name").val(),
                "psd": $("#psd").val()
            },
        function (data) {
            if (data.code < 0) {
                alert(data.message);
            } else {
                window.location = '/admin/user/index';
            }
        }, "json");
    }

    $(function (){
    });

</script>
{{end}}

{{define "user/edit.html"}}
{{template "layout.html" .}}
{{end}}

